package cn.quevo.cube.provide.define.service.impl;

import cn.quevo.common.entity.PageResult;
import cn.quevo.cube.provide.define.dao.CubeColumnSequenceDao;
import cn.quevo.cube.provide.define.entity.CubeColumnSequence;
import cn.quevo.cube.provide.define.entity.query.CubeColumnSequenceQuery;
import cn.quevo.cube.provide.define.service.CubeColumnSequenceService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 字段序列 Service接口实现
 *
 * @author July july_sky@foxmail.com
 * @version 1.0
 * @date 2018/12/11 14:56:58
 * @Copyright 东方浩星（北京）传媒科技有限公司版权所有.All Rights Reserved.
 */
@Service("cubeColumnSequenceService")
@Transactional(transactionManager="transactionManager",rollbackFor={Exception.class})
public class CubeColumnSequenceServiceImpl implements CubeColumnSequenceService {
    @Resource(name="cubeColumnSequenceDao")
    private CubeColumnSequenceDao cubeColumnSequenceDao;

    @Override
    public Map<String,Object> getSinge(CubeColumnSequenceQuery cubeColumnSequenceQuery) {
        return this.cubeColumnSequenceDao.getSinge(cubeColumnSequenceQuery);
    }

    @Override
    public Integer create(CubeColumnSequence cubeColumnSequence) {
        cubeColumnSequence.validateCreate();
        return this.cubeColumnSequenceDao.create(cubeColumnSequence);
    }

    @Override
    public Integer update(CubeColumnSequence cubeColumnSequence) {
        cubeColumnSequence.validateUpdate();
        return this.cubeColumnSequenceDao.update(cubeColumnSequence);
    }

    @Override
    public PageResult<Map<String,Object>> getPage(CubeColumnSequenceQuery cubeColumnSequenceQuery) {
        return this.cubeColumnSequenceDao.getPage(cubeColumnSequenceQuery);
    }
}
